import React, { lazy, Suspense } from 'react'
import { Switch, Redirect, Route } from 'react-router-dom'
// 导入加载提示组件/
import Loading from '../component/Loading'
const Login = lazy(() => import('../views/login/Index'))
const Dashboard = lazy(() => import('../views/Dashboard'))
const Index = () => {
 
    return (
        <Suspense fallback={<Loading />}>
            <Switch>
                <Redirect from="/" to="/dashboard/welcome/index" exact />
                <Route path="/login" component={Login} />
                <Route path="/dashboard" component={Dashboard} />
            </Switch>
        </Suspense>
    );
}

export default Index;
